clc;
syms x;
f(x)=x*(x-pi)*(x-2*pi);
[F,A,B]=fseries(f,x,12,0,2*pi)

figure()
ezplot(f,[0,2*pi]),
hold on,
ezplot(F,[0,2*pi])

figure()
ezplot(f,[-pi,3*pi]),
hold on,
ezplot(F,[-pi,3*pi])